package com.gnerv.cms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gnerv.cms.dto.ArticleDTO;
import com.gnerv.cms.dto.ArticleSearchDTO;
import com.gnerv.cms.entity.Article;
import org.apache.ibatis.annotations.Param;

/**
 * 基础平台-文章表 mapper 接口
 *
 * @author zhang
 * @date 2019/12/2
 **/
public interface ArticleMapper extends BaseMapper<Article> {

    ArticleDTO selectArticle(@Param(value = "articleId") String articleId);

    Page<ArticleDTO> listArticle(@Param(value = "page") Page<ArticleDTO> page, @Param(value = "search") ArticleSearchDTO search);

    int bindCatalogArticle(@Param(value = "catalogId") String catalogId, @Param(value = "articleId") String articleId);

    int unBindCatalogArticle(@Param(value = "articleId") String articleId);

    int updateArticleStatus(@Param(value = "articleId") String articleId, @Param(value = "status") Integer status);
}
